/*
 * MVCME framework (www.radoslaw.biz/mvcme)
 * This framework is an attempt of creating MVC pattern for Java ME.
 * Feel free to change and distribute code and binaries of this project.
 * Should you want to provide any feedback, contact me at kowalski@radoslaw.biz
 */


package biz.radoslaw.mvcme.handler;

import biz.radoslaw.mvcme.MIDletController;

public class EventHandlerFactory {

    private static MIDletController controller;
    
    public static EventHandler create (Class className) throws IllegalAccessException, InstantiationException {
        AbstractEventHandler handler = (AbstractEventHandler)(className.newInstance());
        handler.initalize(controller);
        return handler;
    }

    public static void setController(MIDletController controller) {
        EventHandlerFactory.controller = controller;
    }
}
